package com.yangoxix;

import com.yangoxix.lovegoing.LovegoingApplication;
import com.yangoxix.lovegoing.service.ActivityService;
import com.yangoxix.lovegoing.service.ImageService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.File;

/**
 * @program: lovegoing
 * @description: 测试删除本地文件
 * @author: chenzou
 * @create: 2021-09-25 14:32
 **/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = LovegoingApplication.class)
public class testDeleteLocalFile {
    @Autowired
    private ImageService service;
    @Test
    public void testDeleteLocalFile(){
        String substring = "/image/K3HQDyfmPGTf365ca8f2eabbe19a84796c01f4f18ba4.jpg";
        System.out.println(service.deleteImage(substring)?"success":"fail");
    }
@Test
    public void test(){
        String substring = "/image/K3HQDyfmPGTf365ca8f2eabbe19a84796c01f4f18ba4.jpg";
        String substring1 = substring.substring(7);
        System.out.println(substring1);
    }


//    =======================================
    @Autowired
    private ActivityService activityService;
    @Test
    public void testDeleteActivity(){
        activityService.deleteAct("high you gei me");
    }
}
